home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PACKET / CBBS60SO.ZIP / MBPORT.H < prev    next >
Text File  |  1988-11-12  |  6KB  |  125 lines

  1. /*
  2.  *  MBPORT.H - 10/15/87 - Definitions for MailBox ports.
  3.  */
  4.  
  5. extern byte window;   /* Port bit mask    */
  6. extern byte c_flag;   /* Port command bit */
  7. extern byte b_flag;   /* Port busy bit    */
  8.  
  9. /*
  10.  *  Device connected to the port. (port->dev)
  11.  */
  12.  
  13. #define p_serial    1     /* Device is "raw" serial, another computer */
  14. #define p_tnc       2     /* Device is a tnc with TAPR commands       */
  15. #define p_console   3     /* Device is the local machine console      */
  16.  
  17. /*
  18.  *  Permissions associated with the port. (port->priv)
  19.  */
  20.  
  21. #define p_bbs     0x0001  /* Only BBS may connect to this port        */
  22. #define p_ilcal   0x0002  /* Illegal call kicked off                  */
  23. #define p_ildig   0x0004  /* Illegal digi call no no   (not imp)      */
  24. #define p_mon     0x0008  /* Monitoring ok                            */
  25. #define p_gate    0x0010  /* Gateway out from this port ok            */
  26. #define p_sysop   0x0020  /* Remote sysop allowed (IF user can)       */
  27. #define p_upload  0x0040  /* Upload allowed from this port            */
  28. #define p_dnload  0x0080  /* Download allowed from this port          */
  29.  
  30. /*
  31.  *  Port Mode values. (port->mode)
  32.  */
  33.  
  34. #define sysop   0x0001   /* User is sysop                             */
  35. #define local   0x0002   /* User is local machine console             */
  36. #define remote  0x0004   /* User is not sysop                         */
  37. #define idle    0x0010   /* The port is idle                          */
  38. #define discon  0x0020   /* User has disconnected, but not logged out */
  39. #define timeout 0x0040   /* User timed out, but not yet logged out    */
  40. #define exclude 0x0080   /* User excluded, but not yet logged out     */
  41. #define logout  0x0100   /* User did "B", but not yet logged out      */
  42. #define forced  0x0200   /* User forced off, but not yet logged out   */
  43.  
  44. #define all  (local | remote | sysop)
  45. #define ops  (local | sysop)
  46. #define gone (discon | timeout | forced)
  47.  
  48. /*
  49.  *  Port flags. (port->flags)
  50.  */
  51.  
  52. #define p_dotmr  0x0001  /* Set the input timeout in getdat        */
  53. #define p_dofwd  0x0002  /* "forward for this port now"            */
  54. #define p_clrsys 0x0004  /* Must clear sysop mode on exit if discon*/
  55. #define p_req    0x0008  /* Had a connect request                  */
  56. #define p_give   0x0010  /* Ok to give time to DD on I/O           */
  57. #define p_echo   0x0020  /* Need to echo input to user             */
  58. #define p_lf     0x0040  /* This port needs LF after CR            */
  59. #define p_opreq  0x0080  /* Local console wants to int user        */
  60. #define p_term   0x0100  /* Port was used as terminal              */
  61. #define p_trans  0x0200  /* Port in transparent mode               */
  62.  
  63. typedef struct ports_s
  64. {
  65.   struct ports_s *next;  /* Next port                              */
  66.   struct ports_s *lport; /* Port this one linked to or NULL        */
  67.   char  id;              /* Identifies port to user                */
  68.   byte  idn;             /* Identifies port to op sys              */
  69.   byte  dev;             /* Device connected to the port           */
  70.   byte  ndigi;           /* # digi allowed on connect              */
  71.   word  flags;           /* Flags                                  */
  72.   word  priv;            /* What can you do from this port         */
  73.   word  mode;            /* Present state of the port              */
  74.   word  ctime;           /* "Waiting for input" timeout, seconds   */
  75.   word  dtime;           /* "Waiting for disconnect" timeout, sec  */
  76.   byte  errmax;          /* Allowed command errors before kick off */
  77.   byte  errors;          /* Number of errors user has made         */
  78.   char  *name;           /* Name of the port                       */
  79.  
  80.   byte  ec;              /* Echo TNC to console?                   */
  81.   byte  ecmon;           /* Echo to console while monitoring?      */
  82.   byte  ecuser;          /* Echo to user / forward to console?     */
  83.   byte  eccmds;          /* Echo TNC commands to console?          */
  84.   byte  tmode;           /* Transparent mode used by TNC           */
  85.   word  ftime;           /* Forward timeout time                   */
  86.  
  87.   word  mtime;           /* Allowed monitor time                   */
  88.   word  mcount;          /* Lines allowed in monitor               */
  89.  
  90.   byte  maxhrd;          /* Max on heard list                      */
  91.   byte  nhrd;            /* # presently on heard list              */
  92.   char  *heard;          /* Pointer to calls heard list            */
  93.  
  94.   byte  fwdmin;          /* Minute of the hour to forward          */
  95.   char  rcall[ln_call];
  96.  
  97. /* Task stuff. Doesn't really belong here, but saves an indirect. */
  98.  
  99.   long  itime;           /* Time when wait for input times out     */
  100.   long  expire;          /* Time at which we time this out         */
  101.   byte  flds;            /* # fields in current command            */
  102.   char  *fld[maxflds];   /* Pointers to the start of fields in cmd */
  103.   char  *cmd;            /* The command field text                 */
  104.   char  *line;           /* Text line last collected               */
  105.   char  opt1;            /* Major command id                       */
  106.   char  opt2;            /* Minor command id                       */
  107.   word  cmdcnt;          /* # commands done since login            */
  108.   FILE  *fl;             /* For any file required                  */
  109.   char  *msg;            /* Error msg before prompt, or NULL       */
  110.   struct user_s *user;   /* Pointer to user record                 */
  111.   struct msg_hdr_s *mmhs;/* Pointer to message header record       */
  112. } PORTS;
  113.  
  114. /*
  115.  *  porthd is the list header.
  116.  *  port   is the currently active port.
  117.  *  cport  is the machine console.
  118.  *  pipeid is the local end of the pipe.
  119.  */
  120.  
  121. extern int pipeid;
  122. extern PORTS *porthd, *port, *cport;
  123. extern PORTS *findport();
  124.  
  125.